<?php
// 删除轮播图
// header("content-type:text/html;charset=UTF-8");
include_once("conn.php");

$carouselid = $_GET["carousel"];

$del = "DELETE FROM carousel_pic_infos WHERE pic_Name = '" . $carouselid . "'";

$file_path = "../public/pic/carousel/" . $carouselid;
if (file_exists($file_path)) {
    unlink($file_path); //删除图片文件夹中的图片文件
}

if (!mysqli_query($connect_DB, $del)) {
    echo "<script>alert('删除信息失败！请重试！');history.go(-1)</script>";
} else {
    echo "<script>alert('删除成功！');location='admin_ControlIndexPic.php';</script>";
}

$connect_DB->close();
?>